import * as THREE from 'three'

function createCourse03 (dom: HTMLElement) {
  const scene = new THREE.Scene()
  const camera = new THREE.PerspectiveCamera(45, dom.offsetWidth / dom.offsetHeight, 0.1, 1000)
  const render = new THREE.WebGL1Renderer()
  render.setSize(dom.offsetWidth, dom.offsetHeight)
  dom.appendChild(render.domElement)

  const geometry = new THREE.BoxGeometry()
  const material = new THREE.MeshBasicMaterial({ color: 0xff2288 })
  const cube = new THREE.Mesh(geometry, material)
  scene.add(cube)

  camera.position.z = 5

  cube.rotation.x += 0.80
  cube.rotation.y += 0.80

  render.render(scene, camera)

  return { camera, scene, render }
}

export {
  createCourse03
}
